<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript">
$(function(){
	$(".datepicker").datepicker({dateFormat:'yy-mm-dd',changeMonth:true});
});
</script>
说明：统计销售订单处理进度
<fieldset><legend>查询条件</legend>
<form method="get">
<? include(Q::ini('custom_system/elements_dir') . 'searchform_element.php');?>
<table class="form_table">
<tr>
	<th>出库日期</th>
	<td>
		<input name="begin_shipped_time" value="<?=isset($_GET['begin_shipped_time']) ? $_GET['begin_shipped_time'] : ''?>" class="datepicker" /> to
		<input name="end_shipped_time" value="<?=isset($_GET['end_shipped_time']) ? $_GET['end_shipped_time'] : ''?>" class="datepicker" />
	</td>
</tr>
<tr>
	<th>网站/店铺</th>
	<td>
		<select name="shop_id">
			<option value="">请选择..</option>
			<?foreach ($shop as $s):?>
			<option value="<?=$s['id']?>" <?if (isset($_GET['shop_id']) && $_GET['shop_id']==$s['id']) echo "selected='selected'"?>><?=$s['name']?></option>
			<?endforeach;?>
		</select>
	</td>
</tr>
<tr>
	<th>订单编号</th>
	<td>
		<textarea rows="5" cols="20" name="number"><?=isset($_GET['number']) ? $_GET['number'] : ''?></textarea><br />
		说明：多个订单编号用回车分开
	</td>
</tr>
<tr>
	<td><input type="hidden" name="is_search" value="1" /></td>
	<td><input type="submit" class="button" value="查询" /></td>
</tr>
</table>
</form></fieldset>

<?if (isset($count)):?>
<h3>统计订单数：<?=$count?></h3>
<table class="list_table" width="60%">
<tr>
	<th></th>
	<th>客户下单至客服制单</th>
	<th>客服制单至客服确认</th>
	<th>客服确认至仓库打印</th>
	<th>仓库打印至仓库发货</th>
</tr>
<tr>
	<th>平均</th>
	<td title="<?=$result['avg']['time_1']?>秒"><?=Helper_BSS_Normal::time_difference($result['avg']['time_1'])?></td>
	<td title="<?=$result['avg']['time_2']?>秒"><?=Helper_BSS_Normal::time_difference($result['avg']['time_2'])?></td>
	<td title="<?=$result['avg']['time_3']?>秒"><?=Helper_BSS_Normal::time_difference($result['avg']['time_3'])?></td>
	<td title="<?=$result['avg']['time_4']?>秒"><?=Helper_BSS_Normal::time_difference($result['avg']['time_4'])?></td>
</tr>
<tr>
	<th>最大</th>
	<td title="<?=$result['max']['time_1']?>秒"><?=Helper_BSS_Normal::time_difference($result['max']['time_1'])?></td>
	<td title="<?=$result['max']['time_2']?>秒"><?=Helper_BSS_Normal::time_difference($result['max']['time_2'])?></td>
	<td title="<?=$result['max']['time_3']?>秒"><?=Helper_BSS_Normal::time_difference($result['max']['time_3'])?></td>
	<td title="<?=$result['max']['time_4']?>秒"><?=Helper_BSS_Normal::time_difference($result['max']['time_4'])?></td>
</tr>
<tr>
	<th>最小</th>
	<td title="<?=$result['min']['time_1']?>秒"><?=Helper_BSS_Normal::time_difference($result['min']['time_1'])?></td>
	<td title="<?=$result['min']['time_2']?>秒"><?=Helper_BSS_Normal::time_difference($result['min']['time_2'])?></td>
	<td title="<?=$result['min']['time_3']?>秒"><?=Helper_BSS_Normal::time_difference($result['min']['time_3'])?></td>
	<td title="<?=$result['min']['time_4']?>秒"><?=Helper_BSS_Normal::time_difference($result['min']['time_4'])?></td>
</tr>
</table>
<?endif;?>
<?php $this->_endblock();?>